﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SonCa.SocialNetwork.Web.Admin.IPresenters;
using System.ComponentModel.Composition;
using Core.Common;
using Core.BusinessLogic.Interfaces;
using Core.DataAccess;

namespace SonCa.SocialNetwork.Web.Admin.Presenters
{
    public class MemberPresenter
    {
        private IMemberPresenter _view;

        [Import]
        private IAccountService _accountService;
        [Import]
        private ILevelService _levelService;

        public MemberPresenter()
        {
            MEFManager.Compose(this);
        }

        public void Init(IMemberPresenter view)
        {
            _view = view;            
            List<Account> lstAccount = _accountService.GetAllAccounts();            
            _view.DisplayListMember(lstAccount);
        }

        public List<Level> GetAllLevels()
        {
            return _levelService.GetAllLevels();
        }

        public string GetLevelNameByLevelID(int levelID)
        {
            return _levelService.GetLevelNameByLevelID(levelID);
        }
    }
}